home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
SharedMemory.cc,v
< prev
next >
Wrap
Text File
|
1988-09-21
|
1KB
|
79 lines
head 1.2;
access ;
symbols ;
locks ; strict;
comment @@;
1.2
date 88.09.21.20.51.41; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.18.16.42.29; author grunwald; state Exp;
branches ;
next ;
desc
@@
1.2
log
@*** empty log message ***
@
text
@#include "SharedMemory.h"
#include "SharedMalloc.h"
#include "assert.h"
extern char *sbrk(unsigned);
extern void perror(char *);
extern void exit(int x = 0);
//
// Not really a part of HardwareCpu, but used by it & hidden here.
//
void
SharedMemoryInit( unsigned extra )
{
//
// Bump the break if necessary.
//
assert(extra >= 0);
char * newBreak = sbrk( extra );
if ( newBreak == (char *) -1 ) {
perror( "Share: sbrk" );
exit( 1 );
}
newBreak = sbrk( 0 );
//
// Share .data, .bss, and the extra.
//
extern int environ;
extern char * share( unsigned, unsigned );
unsigned shareStart = (unsigned) &environ;
unsigned shareSize = (unsigned) newBreak - shareStart;
char * sharePointer = share( shareStart, shareSize );
if ( sharePointer == 0 ) {
perror( "Share: share" );
exit( 1 );
}
HardwareMemoryAllocator.disableFurtherBreaks();
}
@
1.1
log
@Initial revision
@
text
@d2 1
d38 2
@